<template>

  <van-swipe :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="(item, index) of banners" :key="index">
      <img @load="swiperImgLoad" :height="item.height/2" :width="item.width/2" v-lazy="item.image"/>
    </van-swipe-item>
  </van-swipe>

</template>
<script>


  export default {
    name: "HomeSwiper",
    props: {
      banners: {
        type: Array,
        default: () => {
          return [];
        }
      }
    },

    methods: {
      swiperImgLoad() {
        // console.log(index + "图片加载了")
        this.$emit("swiperImgLoad");
      }
    }
  }
</script>

<style scoped>

</style>
